#include <windows.h>

LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
HWND hwnd;
HWND hwndLabel;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
	LPSTR lpCmdLine, int nCmdShow) {

	WNDCLASS wc;
	wc.lpszClassName = L"Style2";
	wc.lpfnWndProc = MainWndProc;
	wc.style = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;
	wc.hInstance = hInstance;
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH) (COLOR_WINDOW+1);
	wc.lpszMenuName = L"";
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	RegisterClass(&wc);

	hwnd = CreateWindow(
		//L"Style1",
		//L"Style 1",
		//WS_OVERLAPPEDWINDOW | WS_HSCROLL,
		L"Style2",
		L"Style 2",
		WS_SYSMENU | WS_THICKFRAME,

		CW_USEDEFAULT,
		CW_USEDEFAULT,
		400,
		300,
		NULL,
		NULL,
		hInstance,
		NULL);
	
		hwndLabel = CreateWindow( 
		L"Static", 
		L"This window uses the WS_OVERLAPPEDWINDOW style and the WS_HSCROLL style", 
		WS_VISIBLE | WS_CHILD,
		10,
		10, 
		375, 
		250, 
		hwnd,
		NULL, 
		hInstance, 
		NULL); 
	
	ShowWindow(hwnd, nCmdShow);
	MSG msg;
	while(GetMessage(&msg, NULL, 0, 0 )) {
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	
	return (int) msg.wParam;
}

LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, 
							 WPARAM wParam, LPARAM lParam) { 
	HWND hwdCtl = (HWND) lParam;
	switch (msg) {
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;
		default:
			return DefWindowProc(hWnd, msg, wParam, lParam);	
	}
	return 0;
}

